#include "ChimeraManager.h"
#include "ObjLoader.h"

ChimeraManager::ChimeraManager(void)
{
	MainMesh = 0;
}

void ChimeraManager::Load(QString path)
{
	//load everything u need here
	LoadMesh(path);
}

void ChimeraManager::LoadMesh(QString path)
{
	for (int i = 0; i < Tools.count(); i++)
	{
		Tools.at(i)->FreeSelectedAreaInformation();
	}
	if(MainMesh != 0)
		delete MainMesh;
	MainMesh = ObjLoader::LoadObj(path);
}

void ChimeraManager::Run()
{
	//run hardware and handle events
	//RunHardware();
	//run tracking and calibration and handle events
	//RunTracking();
	//RunCalibration();
}

ChimeraManager::~ChimeraManager(void)
{
	delete MainMesh;
	for (int i = 0; i < Tools.count() ; i++)
	{
		delete Tools.at(i);
	}
}
